<?php
class M_user extends CI_Model{
    public function __construct() {
        parent::__construct();
        $this->load->database();
    }
    public function kt_user($email, $pass){
        $query = "SELECT * FROM users WHERE email = '$email' AND pass = '$pass'";
        $result = $this->db->query($query);
        return $result->result_array();
    }
    public function register($first_name,$last_name,$email,$pass){
        $data = array(
            'first_name'=>$first_name,
            'last_name'=>$last_name,
            'email'=>$email,
            'pass'=>$pass
        );
        $result = $this->db->insert('users',$data);
        return $result;
    }
    public function select($email){
        $result = $this->db->get_where('users',array('email'=>$email));
        return $result->result_array();
    }
}
?>
